/*
* Copyright 2008 Google Inc.
* Licensed under the Apache License, Version 2.0:
*  http://www.apache.org/licenses/LICENSE-2.0
*/
package net.es.weathermap{

import flash.text.TextField;

import mx.containers.TabNavigator;
import mx.containers.VBox;
import mx.core.UIComponent;
import mx.controls.TextArea;
import mx.controls.DataGrid;


/**
 * InfoWindowSprite consists of several ellipses arranged in a 'thought bubble'
 * manner, the largest of which contains an embedded image and a circular
 * close button.
 * It can dispatch an Event instance (type: "close"), which the user can listen
 * for and use to call map.closeInfoWindow();
 */
public class InfoWindowTabbedComponent extends UIComponent {

  public function InfoWindowTabbedComponent(table:Array) {
    // Add body text
    var tabNavigator:TabNavigator = new TabNavigator();
    tabNavigator.width = 680;
    tabNavigator.height = 225;
    tabNavigator.addChild(createTab("Utilization",table));
    addChild(tabNavigator);

    cacheAsBitmap = true;
  }

  public function createTab(label:String,table:Array):VBox {
      var tab:VBox = new VBox();
      tab.label = label;
      var dg:DataGrid = new DataGrid();
      // dg.wordWrap = true;
      dg.dataProvider = table;
      dg.columns[0].width = 200;
      dg.columns[1].width = 135;
      dg.columns[2].width = 135;
      dg.columns[3].width = 135;
      tab.addChild(dg);
      return tab;
  }
}

}
